/**
 * Fetch:
 * 
 * 
 * 
 */
const  fetch  = require('node-fetch');

/* 
  fetch('http://jsonplaceholder.typicode.com/users').then((res)=>{
   return res.text();
  },(err)=>{
    console.log(err);
  }).then((data)=>{
    console.log(data);
  },(err)=>{
    console.log(err);
  }); */

!(async ()=>{
  let result = await fetch('http://jsonplaceholder.typicode.com/users',{params:{id:5}}).then((res)=>{return res.text()});
  let body = JSON.parse(result);
  body.forEach(element => {
    console.log(element.id);
    console.log(element.name);
    console.log(element.address.city);
    console.log(element.email);
    console.log(element.phone);
  });
  
  
})()